﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SisTransportes.Apresentacao.WebForm.Demo
{
    public partial class DemoMultView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 0;
            this.CurrentTabs(1);
        }

        protected void BtnView1_Click(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 1;
            this.CurrentTabs(2);
            
        }

        protected void BtnView2_Click(object sender, EventArgs e)
        {
            //voltar
            MultiView1.ActiveViewIndex = 2;
            this.CurrentTabs(3);

        }

        protected void BtnView3_Click(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 0;
            this.CurrentTabs(1);

        }


        protected void CurrentTabs(int indice)
        {
            switch (indice)
            {
                case 1:
                    HyperLink1.CssClass = "current";
                    HyperLink2.CssClass = "";
                    HyperLink3.CssClass = "";
                    break;

                case 2:
                    HyperLink1.CssClass = "";
                    HyperLink2.CssClass = "current";
                    HyperLink3.CssClass = "";
                    break;

                case 3:
                    HyperLink1.CssClass = "";
                    HyperLink2.CssClass = "";
                    HyperLink3.CssClass = "current";
                    break;

                default:
                    HyperLink1.CssClass = "";
                    HyperLink2.CssClass = "";
                    HyperLink3.CssClass = "";
                    break;
            }
            
        }

    }
}